﻿<UserControl x:Class="Tisbi.LawFirm.UI.Views.Controls.ClaimsGreed"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="600">
    <Grid DataContext="{Binding Source={StaticResource Locator}, Path=ClaimsViewModel}">
        <Grid.Background>
            <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.InactiveBorderColorKey}}"/>
        </Grid.Background>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50" MaxWidth="50" />
            <ColumnDefinition Width="50" MaxWidth="50" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <mui:ModernButton Command="{Binding CreateCommand}" Grid.Row="0" Grid.Column="0" EllipseDiameter="22" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="12" IconHeight="12" ToolTip="Добавить" IconData="{StaticResource AddIconData}" Width="34" />
        <mui:ModernButton Command="{Binding EditCommand}"  Grid.Row="0" Grid.Column="1" EllipseDiameter="22" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="12" IconHeight="12" ToolTip="Редактировать" IconData="{StaticResource EditIconData}" Width="34" />
        <mui:ModernButton Command="{Binding RemoveCommand}" Grid.Row="0" Grid.Column="2" EllipseDiameter="22" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="12" IconHeight="12" ToolTip="Удалить" IconData="{StaticResource RemoveIconData}" Width="34" />
        <mui:BBCodeBlock Visibility="{Binding HasVarnings}" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Foreground="Red" Margin="5" BBCode="{Binding Varnings}" />

        <StackPanel Grid.Row="1" Grid.ColumnSpan="3" Grid.Column="0" >
            <ScrollViewer>
                <StackPanel>
                    <DataGrid AutoGenerateColumns="False" IsReadOnly="True" ItemsSource="{Binding Model}" SelectedItem="{Binding SelectedModelItem, Mode=TwoWay}">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=Id}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="№" />
                            <DataGridTextColumn Binding="{Binding Path=Created}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Дата создания" />
                            <DataGridTextColumn Binding="{Binding Path=DateOfIncoming}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Дата поступления" />
                            <DataGridTextColumn Binding="{Binding Path=Creator.Title}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Кто направил претензию" />
                            <DataGridTextColumn Binding="{Binding Path=AssingnCustomers.Title}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Кому" />
                            <DataGridTextColumn Binding="{Binding Path=DateOfSending}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Дата отправления" />
                            <DataGridTextColumn Binding="{Binding Path=NumberOfNotice}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="№ уведомления" />
                            <DataGridTextColumn Binding="{Binding Path=DateOfReceip}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Дата вручения" />
                            <DataGridTextColumn Binding="{Binding Path=ContentRequirements}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Краткая суть" />
                            <DataGridTextColumn Binding="{Binding Path=ResultOfDecision}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Результат рассмотрения претензии" />
                            <DataGridTextColumn Binding="{Binding Path=DateOfDecision}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Дата рассмотрения претензии" />
                            <DataGridTextColumn Binding="{Binding Path=ClaimAmount}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Сумма претензии" />
                            <DataGridTextColumn Binding="{Binding Path=Comments}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Комментарий" />
                            <DataGridTextColumn Binding="{Binding Path=Lawsuitses.Id}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Номер иска" />
                        </DataGrid.Columns>
                    </DataGrid>
                </StackPanel>
            </ScrollViewer>
        </StackPanel>
    </Grid>
</UserControl>
